#pragma once
#include <game/Config.h>

#include <game/debug/ScreenManagerDebug.h>
#include <memory>
#include <Signals.h>

ARELLO_GAME_NAMESPACE_DECL_START

class ScreenManager;
class ServiceProvider;

class ScreenManagerDebugImpl
	: public debug::ScreenManagerDebug
{
public:
	ScreenManagerDebugImpl(ScreenManager& sm);
	~ScreenManagerDebugImpl();

	void InvokeScreenChanged(const std::string& newScreen);
public: // ScreenManagerDebug
	virtual liba::signals::signal<void (std::string)>& ScreenChanged() { return this->screenChanged; }
	virtual const std::string& GetCurrentScreenName();
	virtual std::vector<std::string> GetExitNames();
	virtual void ScheduleSwitch(const std::string& exitId);
	virtual void ScheduleRestart();
private:
	ScreenManager& screenManager;
	std::string currentScreenName;
	liba::signals::signal<void (std::string)> screenChanged;
};

ScreenManagerDebugImpl* Register(std::auto_ptr<ScreenManagerDebugImpl> debugImpl, ServiceProvider& sp);

ARELLO_GAME_NAMESPACE_DECL_END